package org.ezplatform.office.rd.psyj.dao;

import org.ezplatform.core.dao.jpa.JpaBaseDao;


import org.ezplatform.office.rd.psyj.entity.PsyjEntity;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

import org.springframework.data.jpa.repository.Modifying;
/**
 * @program:
 * @description: 批示意见dao层
 * @author: zengls
 * @create: 2021-09-07 17:43
 **/
@Repository("psyjDao")
public abstract interface PsyjDao extends JpaBaseDao<PsyjEntity, String>{

    //查询某条数据下批示意见
    @Query(value="select id,content,signtime,user_name,task_def_name from BPM_PROCESS_COMMENT where processinstance_id=?1",nativeQuery = true)
    public abstract List<Map> getPsyjList(String num);

    //修改批示意见
    @Query(value="update BPM_PROCESS_COMMENT set content=:content where id=:id",nativeQuery = true)
    @Modifying
    public abstract int updatePsyj(@Param("id") String id, @Param("content") String content);

    //修改批示意见时间
    @Query(value="update BPM_PROCESS_COMMENT set signtime=:content where id=:id",nativeQuery = true)
    @Modifying
    public abstract int updatePsyjTime(@Param("id") String id, @Param("content") String content);

    //删除批示意见
    @Query(value="delete from BPM_PROCESS_COMMENT  where id=?1",nativeQuery = true)
    @Modifying
    public abstract int delPsyj(String id);






}
